<template>
  <div class="detail-container">
    <button class="back-button" @click="goBack">后退</button>
    <h4>书籍 {{ id }} 的详情页面</h4>
    <h3>{{ description }}</h3>
  </div>
</template>
<script setup>
import { useRoute,useRouter } from 'vue-router'
import { computed } from 'vue'
const props = defineProps({
    id: String
})
const route = useRoute()
const router = useRouter()
const description = computed(() => {
    const data=route.query.description
    if(data){
        return data 
    }
    else{
        return '暂无描述'
    }
})
const goBack = () => {
    router.back()
}
</script>






<style scoped>
.detail-container {
  max-width: 700px;
  margin: 40px auto;
  padding: 30px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', sans-serif;
}

.back-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #409EFF;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.back-button:hover {
  background-color: #337ecc;
  transform: translateY(-2px);
}

h4 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

h3 {
  font-size: 18px;
  color: #555;
  line-height: 1.6;
  font-weight: normal;
}
</style>